Forecast Hospital cases using Prophet model using extra regressor variables from vaccine data for those who received 2nd dose of vaccine in the small to middle age groups (5 - 40). 3 days of forecast.

Initial Data Cleaning

Vaccine data, Cases data from the hospital, and the waste water signal data has been loaded, cleaned, and then merged into one final dataframe, final_data.

The variables have been log transformed.

The response variable observed_census_ICU_p_acute_care has been renamed as y and the date has been renamed as ds to fit the prophet model.

The dataset is divided into train and test set. The test set consist of last 3 days of data.

Adding other variable as regressors to the model.

Fitting the Prophet Model.

Forecasting 3 days into future.

Checking last 6 days of forecast data

#>             ds     yhat yhat_lower yhat_upper
#> 407 2022-01-27 5.151949   4.413655   5.849891
#> 408 2022-01-28 5.188484   4.375565   5.860269
#> 409 2022-01-29 5.180680   4.461483   5.889761
#> 410 2022-01-30 5.284817   4.572006   5.948880
#> 411 2022-01-31 5.195035   4.499846   5.914633
#> 412 2022-02-01 5.276143   4.592303   6.023286

The plot of actual data and predicted data from Prophet forecast. The blue line is predicted data whereas the black dots are actual data.

Root Mean Squared Error on the train data:

#> [1] 17.15557

MAPE on train set:

#> [1] 0.3230894

Standard deviation of the actual data

#> [1] 35.92902

Plots comparing actual data and predicted data

RMSE on test set

#> [1] 110.295

MAPE on test set

#> [1] 1.369034

Plots comparing actual data and predicted data

The error metrics are high when model is regressed against only those who received 2nd dose in the small to middle age groups.

Component plot showing yearly and weekly trend of the model.

The model trend shows a strong linear increase in cases until April/ May 2021 and then it increases slightly until September/ October 2021. After that there it increases very slightly/ remains pretty much consistent until January 2022. The extra regressor plot shows the additive effect of regressors and it shows that 2nd dose of vaccination in smaller to middle age groups remains high until April/May 2021 and then shows a sharp decrease in July 2021 and then shows a slight weak linear increase until January 2022. Weekly trend shows there are more hospitalizations on Tuesday and Thursday.